﻿namespace StyleCop.For.ReSharper.TestProject.Readability
{
    public class BaseClass
    {
        #region Public Methods

        public virtual string BaseMethod1(string first, string last)
        {
            return string.Empty;
        }

        public virtual string BaseMethod2(string first, string last)
        {
            return string.Empty;
        }

        protected void BaseMethod3()
        {
        }

        #endregion
    }

    internal class SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists : BaseClass
    {
        #region Public Methods

        new private void BaseMethod3()
        {
            // this should be a call to base and not this
            base.BaseMethod3();
        }

        public string Method1()
        {
            var name = base.BaseMethod1("John", "Doe");
            return name;
        }

        public string Method2()
        {
            var name = base.BaseMethod2("John", "Doe");
            return name;
        }

        public override string BaseMethod2(string first, string last)
        {
            if (first == last)
            {
                return string.Empty;
            }

            return base.BaseMethod2(first, last);                                                                                
        }

        #endregion
    }
}